<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Services\CacheService;
use Illuminate\Support\Facades\Redis;
use App\Models\Linkslistsqrcodes;

class Linksqrcodes extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'links:qrcodes';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '每天早上1点更新昨天的二维码识别数据';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        //清空当日扫码数据
        Linkslistsqrcodes::clearLinksListsQrcodesScan();
        //清空每天统计的小程序暂停服务个数
        Redis::del("today_mini_times_".date("Ymd",strtotime("-1 day")));
    }
}
